package io.sxl.modules.generator.dao;

import io.sxl.modules.generator.entity.HouseEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.sxl.modules.generator.entityx.HouseShowEntity;
import io.sxl.modules.generator.entityx.IsFinish;
import io.sxl.modules.generator.entityx.XiaoquAndNum;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 *
 *
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2021-03-26 20:06:25
 */
@Mapper
public interface HouseDao extends BaseMapper<HouseEntity> {

     @Select("SELECT h.id,h.`huxing`,h.`suqare`,h.`xiaoqu`,h.`dong_id`,h.`house_num`,f.`name` family_name  ,p.`name` project_name FROM tb_house h LEFT JOIN tb_project p ON h.`project_id`=p.`id` left join tb_family f on h.host_id=f.id limit #{page},#{limit}")
     List<HouseShowEntity> getHouseShow(Map<String, Object> params);

     /*自定义条件查询showhouse*/
     List<HouseShowEntity> queryByHousePage(Map<String,Object> params);
     Integer queryByHousePageCount(Map<String,Object> params);

     /*自定义的数字条件查询*/
     List<HouseShowEntity> queryLikeNumber(Map<String,Object> params);
     Integer queryLikeNumberCount(Map<String,Object> params);

     /*自定义的汉字条件查询*/
     List<HouseShowEntity> queryLikeStr(Map<String,Object> params);
     Integer queryLikeStrCount(Map<String,Object> params);

     List<HouseShowEntity> queryByProIdAndHostNotNull(Map<String,Object> params);
     Integer queryByProIdAndHostNotNullCount(Map<String,Object> params);



     Boolean diaobo(Integer key, List<Integer> lists);

     Boolean fenpei(Integer hostid,Integer familyId);

     List<XiaoquAndNum> queryMainXiaoqu();

     IsFinish queryIsFinish(String xiaoqu);

}
